package com.buydeem.factory.method;


import com.buydeem.factory.simple.Vehicle;


/**
 * 工厂方法
 *
 * @author zengchao
 * @date 2022-04-22 16:55:55
 */
public class App {
    public static void main(String[] args) {
        IVehicleFactory factory = new BusFactory();
        Vehicle bus = factory.create();
        bus.printName();

        factory = new CarFactory();
        Vehicle car = factory.create();
        car.printName();

        factory = new TruckFactory();
        Vehicle truck = factory.create();
        truck.printName();

    }
}
